package per.wsj.room.data.dao

import androidx.lifecycle.LiveData
import androidx.room.*
import per.wsj.room.data.entity.User

@Dao
interface UserDao {

    /**
     * 查询
     */
    @Query("SELECT * FROM user")
    fun getUsers():LiveData<List<User>>

    /**
     * 删除
     */
    @Delete
    fun delUser(user:User)

    /**
     * 添加
     */
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertUser(user:User)
}